<?php
/**
 * Created by PhpStorm.
 * User: Admin
 * Date: 2018/7/23
 * Time: 22:27
 */
namespace app\index\controller;

use app\common\model\Work;

class Theme extends Index
{
    public function index()
    {
        $cate=db('work_theme')->where('id',input('id'))->value('cids');
        $data=db('work')->where('cid','in',$cate)->order('id desc')->paginate();
        $child=db('category')->where('id','in',$cate)->order('weigh asc')->select();
        $this->assign('data',$data);
        $this->assign('child',$child);
//        $this->assign('pid',$cate[0]);
        $this->assign('pid',0);
        return view('category/lists');
    }
}